//
//  NSDateAdditions.h
//  Tint
//
//  Created by Kevin Wu on 2/22/12.
//  Copyright (c) 2012 Telligenty. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDate (Tint)

/*
 * Creating
 */
+ (NSDate *)dateWithUNIXTimeString:(NSString *)string;
+ (NSDate *)dateTomorrow;
+ (NSDate *)dateYesterday;
+ (NSDate *)dateWithDaysFromNow:(NSUInteger)days;
+ (NSDate *)dateWithDaysBeforeNow:(NSUInteger)days;
+ (NSDate *)dateWithHoursFromNow:(NSUInteger)hours;
+ (NSDate *)dateWithHoursBeforeNow:(NSUInteger)hours;
+ (NSDate *)dateWithMinutesFromNow:(NSUInteger)minutes;
+ (NSDate *)dateWithMinutesBeforeNow:(NSUInteger)minutes;
+ (NSDate *)dateWithSecondsFromNow:(NSUInteger)seconds;
+ (NSDate *)dateWithSecondsBeforeNow:(NSUInteger)seconds;
- (NSDate *)dateAtStartOfDay;
- (NSDate *)dateAtNoonOfDay;

/*
 * Date components
 */
- (NSDateComponents *)dateComponents;

/*
 * Adjusting
 */
- (NSDate *)dateByAddingDays:(NSUInteger)days;
- (NSDate *)dateBySubtractingDays:(NSUInteger)days;
- (NSDate *)dateByAddingHours:(NSUInteger)hours;
- (NSDate *)dateBySubtractingHours:(NSUInteger)hours;
- (NSDate *)dateByAddingMinutes:(NSUInteger)minutes;
- (NSDate *)dateBySubtractingMinutes:(NSUInteger)minutes;
- (NSDate *)dateByAddingSeconds:(NSUInteger)seconds;
- (NSDate *)dateBySubtractingSeconds:(NSUInteger)seconds;

/*
 * Comparing
 */
- (BOOL)isEarlierThanDate:(NSDate *)dt;
- (BOOL)isLaterThanDate:(NSDate *)dt;

- (BOOL)isSameYearAsDate:(NSDate *)dt;
- (BOOL)isSameMonthAsDate:(NSDate *)dt;
- (BOOL)isSameDayAsDate:(NSDate *)dt;
- (BOOL)isSameWeekAsDate:(NSDate *)dt;

/*
 * Intervals
 */
- (NSInteger)daysSinceDate:(NSDate *)dt;
- (NSInteger)hoursSinceDate:(NSDate *)dt;
- (NSInteger)minutesSinceDate:(NSDate *)dt;
- (NSInteger)secondsSinceDate:(NSDate *)dt;

@end
